package com.cwt_taxi_xa.model;

import com.cwt_taxi_xa.protocol.BusinessFactory;
import com.cwt_taxi_xa.protocol.EncoderUtil;
import com.cwt_taxi_xa.util.DateUtil;

import java.util.ArrayList;

/**
 * 音视频实体类
 * @author wlh
 *
 * 对象创建的时间即为媒体ID
 */
public class RecorderInfo {

	public RecorderInfo() {
		super();
	}

	private byte[] fileHead;

	/**
	 * 录音原因
	 * 0:正常录音 1:乘客不满意投诉 2：报警录音
	 */
	public RecorderInfo(int reason) {
		super();
		this.reason = reason;
		setMediaId();
		setTime();
		setsLat(EncoderUtil.getCurretnLat());
		setsLng(EncoderUtil.getCurretnLng());
	}

	/**
	 * 多媒体ID
	 * 十进制int
	 */
	private String mediaId;

	/**
	 * 录音时间、文件名称
	 * YYMMddHHmmss
	 */
	private String time;

	/**
	 * 结束
	 * YYYYMMddHHmmss
	 */
	private String etime;

	/**
	 * 录音原因
	 * 0:正常录音 1:乘客投诉 2：报警录音
	 */
	private int reason;

	/**
	 * 流水号
	 * 请求上传时的消息流水号
	 */
	private int serialId;

	/**
	 * 数据(分包)，用于上传
	 */
	private ArrayList<byte[]> listData;

	/**开始录音纬度*/
	private int sLat;

	/**开始录音经度*/
	private int sLng;

	/**结束录音纬度*/
	private int eLat;

	/**结束录音经度*/
	private int eLng;

	private long size;	// 文件大小

	public String getMediaId() {
		return mediaId;
	}

	public void setMediaId() {
		/**yyyyMMddHHmmss*/
		String time = DateUtil.getTodayDate(DateUtil.df6);
		String mediaId = String.valueOf(BusinessFactory.getMediaIdForInt(time));
		this.mediaId = mediaId;
	}

	public void setTime() {
		String time = DateUtil.getTodayDate(DateUtil.df8);
		this.time = time;
	}

	public ArrayList<byte[]> getListData() {
		return listData;
	}

	public void setListData(ArrayList<byte[]> listData) {
		this.listData = listData;
	}

	public void setMediaId(String mediaId) {
		this.mediaId = mediaId;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	/**
	 * 录音原因
	 * 0:正常录音 1:乘客投诉 2：报警录音
	 */
	public int getReason() {
		return reason;
	}

	public void setReason(int reason) {
		this.reason = reason;
	}

	public int getSerialId() {
		return serialId;
	}

	public void setSerialId(int serialId) {
		this.serialId = serialId;
	}

	public int getsLat() {
		return sLat;
	}

	public void setsLat(int sLat) {
		this.sLat = sLat;
	}

	public int getsLng() {
		return sLng;
	}

	public void setsLng(int sLng) {
		this.sLng = sLng;
	}

	public int geteLat() {
		return eLat;
	}

	public void seteLat(int eLat) {
		this.eLat = eLat;
	}

	public int geteLng() {
		return eLng;
	}

	public void seteLng(int eLng) {
		this.eLng = eLng;
	}

	public long getSize() {
		return size;
	}

	public void setSize(long size) {
		this.size = size;
	}

	public String getEtime() {
		return etime;
	}

	public void setEtime(String etime) {
		this.etime = etime;
	}

	public byte[] getFileHead() {
		return fileHead;
	}

	public void setFileHead(byte[] fileHead) {
		this.fileHead = fileHead;
	}

}
